#!/bin/bash

# was: (Timer_test <$nul 2>&1 | ...)
# (Timer_test 2>&1 | grep -v 'Timing on' | sed -e 's/^/TEST>> /' -e 's/[0-9]\.[0-9]*//g')
# (Timer_test 2>&1 | tee Timer_test.raw | grep -v 'Timing on' | sed -e 's/^/TEST>> /' -e 's/[0-9]\.[0-9].*$//')
# (Timer_test 2>&1 | grep -v 'Summary of timers' | grep -v 'Timing on' | sed -e 's/^/TEST>> /' -e 's/[0-9]\.[0-9].*$//')

perlcmd=(perl -pe 'binmode(STDOUT); s/Timing on .*\)/Timing on ...)/; s/Summary of timers \(.*\)/Summary of timers (...)/; s/:.*$/:/')
perlcmd=(perl -pe 'binmode(STDOUT); s/Timing on .*\)/Timing on ...)/; s/Summary of timers \(.*\)/Summary of timers (...)/; s/ *[0-9]\.[0-9].*//')

cout=Timer_test.cout
cerr=Timer_test.cerr

Timer_test >$cout 2>$cerr  # | perl -pe 'binmode(STDOUT); s/[0-9]\.[0-9].*$//'

echo '** cerr:'
cat $cerr | "${perlcmd[@]}"
echo '** cout:'
cat $cout | "${perlcmd[@]}"

rm -f $cout $cerr
